@import '~styles/settings.scss';

.c-lollipop-chart {
  position: relative;
  font-size: rem(12px);
  color: $slate;

  .unit-legend {
    position: relative;
    margin-bottom: 4px;
    z-index: 2;
    background-color: white;
    color: $slate-light;
    font-weight: 500;

    @media screen and (min-width: $screen-m) {
      margin-left: 40%;
      text-align: center;
    }
  }

  .custom-xAxis {
    position: relative;
    z-index: 2;
    height: 20px;
    width: 100%;
    border-bottom: 1px solid black;
    background-color: white;
    padding: 0 10px;

    .axis-wrapper {
      @media screen and (min-width: $screen-m) {
        margin-left: 40%;
      }
    }

    .custom-xAxis-ticks {
      height: 10px;
      position: relative;
    }
  }

  .list-wrapper {
    position: relative;
    max-height: rem(340px);
    overflow-y: auto;
  }

  .list-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: rem(10px) 0;

    @media screen and (min-width: $screen-m) {
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }

    &:hover {
      background-color: rgba($border, 0.5);

      .item-bubble {
        background-color: $slate-light;
        color: $white;
      }
    }

    &.-bar {
      flex-direction: column;
      align-items: flex-start;
      margin-bottom: rem(20px);
    }
  }

  a {
    color: $slate;

    &:hover {
      .item-name {
        text-decoration: underline;
      }
    }
  }

  .disabled {
    pointer-events: none;
    text-decoration: none;

    &:hover {
      text-decoration: none;
    }
  }

  .item-bubble {
    display: flex;
    justify-content: center;
    align-items: center;
    width: rem(16px);
    min-width: rem(16px);
    height: rem(16px);
    min-height: rem(16px);
    border-radius: 50%;
    background-color: $border;
    position: relative;
    margin-right: 10px;

    &.-lollipop {
      position: absolute;
      margin-right: 0;
    }
  }

  .item-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: right;
    margin-bottom: 10px;

    @media screen and (min-width: $screen-m) {
      width: 40%;
      margin-bottom: 0;
      padding: 0 rem(15px) 0 10px;
      justify-content: space-between;
    }
  }

  .lollipop {
    position: relative;
    display: inherit;
    flex-direction: inherit;
    align-items: center;
  }

  .space-right {
    padding-right: 50px;

    @media screen and (min-width: $screen-m) {
      padding-right: 67px;
    }
  }

  .space-left {
    padding-left: 50px;

    @media screen and (min-width: $screen-m) {
      padding-left: 67px;
    }
  }

  .item-lollipop-bar {
    position: relative;
    display: flex;
    align-items: center;
    height: rem(18px);

    @media screen and (min-width: $screen-m) {
      width: 60%;
    }

    .item-spacer {
      height: 1px;
    }

    .item-bar {
      position: absolute;
      height: rem(2px);
      width: 100%;
      top: -1px;
      left: 0;
      margin-left: 0;
      margin-right: 0;
    }
  }

  .item-value {
    position: absolute;
    width: rem(35px);
    text-align: right;
    margin: 0 16px;
  }

  .cartesian-grid {
    position: absolute;
    top: 40px;
    bottom: 0;

    .grid-line {
      bottom: 0;
      top: 0;
      width: 1px;
      background-color: $border;
    }
  }
}
